package cc.sunwl.decorator;

public abstract class Decorator extends Component {

    protected Component component;

    /**
     * 重写方法，实际执行的是Component的operation方法
     */
    @Override
    void Operation() {
        if (component != null) {
            component.Operation();
        }
    }

    public void setComponent(Component component) {
        this.component = component;
    }

}
